package com.groupbuying.storeinternal.dao;

import com.groupbuying.storeinternal.domain.StoreAccountWxinfoRelDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigInteger;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 商户微信登录信息关联表
 * @author gaoruijun
 * @email 18511893135@163.com
 * @date 2019-07-04 09:45:03
 * @des
 */

@Mapper
@Repository
public interface StoreAccountWxinfoRelDao {

	StoreAccountWxinfoRelDO get(BigInteger id);

	List<StoreAccountWxinfoRelDO> list(Map<String, Object> map);

	int count(Map<String, Object> map);

	int save(StoreAccountWxinfoRelDO storeAccountWxinfoRelDO);

	int update(StoreAccountWxinfoRelDO storeAccountWxinfoRel);

	int remove(BigInteger id);

	int batchRemove(BigInteger[] ids);

	StoreAccountWxinfoRelDO getByAccountAndOpen(@Param("accountId") String accountId, @Param("openId") String openId);

	List<StoreAccountWxinfoRelDO> getByAccount(String accountId);

	List<StoreAccountWxinfoRelDO> getByOpenId(String openId);

	int removeByAccountIdAndOpenId(@Param("accountId") String accountId, @Param("openId") String openId);

	Set<String> getOpenIdByAccount(List<String> accountList);
	int removeByAccountId(List<String> accountList);

	/**
	 * 根据openId删除服务商登陆信息
	 * @param openId
	 * @return
	 */
	int deleteByOpenId(String openId);
}
